//
//  ServiceRangePageController.m
//  WashForU
//
//  Created by 王俊 on 15/12/7.
//  Copyright © 2015年 王俊. All rights reserved.
//

#import "ServiceRangePageController.h"

@interface ServiceRangePageController ()
@property(nonatomic,strong)UIImageView  *mapImageView;
@property(nonatomic,strong)UILabel      *texttitleLabel;
@property(nonatomic,strong)UILabel      *textLabel;
@end

@implementation ServiceRangePageController

- (void)viewDidLoad {
    [super viewDidLoad];
    [self customViewSetUp];
    [self customConstrainsAdd];
    [self targetAdd];
}
/*****************添加视图组件********************/
- (void)customViewSetUp
{
    self.titleLabel.text = @"服务说明";
    self.mapImageView = [[UIImageView alloc]init];
    self.texttitleLabel = [[UILabel alloc]init];
    self.textLabel  = [[UILabel alloc]init];
    self.textLabel.numberOfLines = 0;
    self.texttitleLabel.text = @"洗护区域说明";
    self.textLabel.text = @"成都市已开通服务，主要区域为五大城区以及高新区";
    self.texttitleLabel.textAlignment = NSTextAlignmentCenter;
    self.textLabel.textAlignment = NSTextAlignmentLeft;
    self.texttitleLabel.font = [UIFont boldSystemFontOfSize:15];
    self.textLabel.font = [UIFont CustomFont:15];
    self.mapImageView.image = [UIImage imageNamed:@"配送范围"];
    
    
    [self.view addSubview:self.texttitleLabel];
    [self.view addSubview:self.textLabel];
    [self.view addSubview:self.mapImageView];
    
    
    
}
/*******************添加约束**********************/
- (void)customConstrainsAdd
{
    [self.texttitleLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(self.upView.mas_bottom).offset(5);
        make.leading.equalTo(self.view).offset(15);
        make.trailing.equalTo(self.view).offset(-15);
        make.height.mas_equalTo(30);
    }];
    [self.textLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.width.leading.equalTo(self.texttitleLabel);
        make.height.mas_equalTo(60);
        make.top.equalTo(self.texttitleLabel.mas_bottom);
    }];
    [self.mapImageView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.width.leading.equalTo(self.view);
        make.top.equalTo(self.textLabel.mas_bottom);
        make.height.equalTo(self.mapImageView.mas_width).multipliedBy(652.0/874.0);
    }];

}
/*******************添加事件**********************/
- (void)targetAdd
{

    [self.backButton addTarget:self action:@selector(backButtonClicked) forControlEvents:UIControlEventTouchUpInside];
}

@end
